package cn.besbing.server.utils;

import com.aspose.cells.License;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

public class AsposecellInstance {

    public static Boolean getAsposeLicense(){

        Boolean result = false;

        try{
            String license = "<License>\n" +
                    "<Data>\n" +
                    "<Products>\n" +
                    "<Product>Aspose.Total for Java</Product>\n" +
                    "</Products>\n" +
                    "<EditionType>Enterprise</EditionType>\n" +
                    "<SubscriptionExpiry>20991231</SubscriptionExpiry>\n" +
                    "<LicenseExpiry>20991231</LicenseExpiry>\n" +
                    "<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>\n" +
                    "</Data>\n" +
                    "<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>\n" +
                    "</License>";
            InputStream is = new ByteArrayInputStream(license.getBytes("UTF-8"));
            License asposeLic = new License();
            asposeLic.setLicense(is);
            result = true;
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
    }

}
